<template>
    <el-container>
        <el-main>
            <div id='formPreview' class="formPreview"></div>
        </el-main>
    </el-container>
</template>

<script>
    import {getStartForm} from '../../api/process.api'
    import AllComponents from 'formiojs/components';
    import Components from 'formiojs/components/Components';
    import FormIoForm from 'formiojs/Form';
    import 'formiojs/dist/formio.full.min.css'
    import {getFormDefine} from '../../api/task.api'

    Components.setComponents(AllComponents);

    export default {
        name: "ApplyManager",
        mounted() {
            getStartForm(this.$route.query.processId).then((res) => {
                getFormDefine(res.key).then((res) => {
                    new FormIoForm(document.getElementById('formPreview'), res.model).ready.then((instance) => {
                        this.formIo = instance;
                    }).catch((error)=>{
                        alert("出货了")
                    });
                })
            })
        }
    }
</script>

<style scoped>

</style>
